<%- include('../public/page_header.html')%>
<script type="text/javascript" src="/admin/bootstrap/js/bootstrap.js"></script>
<!-- 富文本编辑器 -->
<link href="/wysiwyg-editor/css/froala_editor.pkgd.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/wysiwyg-editor/js/froala_editor.pkgd.min.js"></script>
<script type="text/javascript" src="/wysiwyg-editor/js/languages/zh_cn.js"></script>
<style>
  .nav-tabs{
    background-color: #eee;
  }
  .nav-tabs li{
    padding: 0 5px;
  }
  .tab-content{
    position: relative;
    top: -12px;
    background-color: #fff;
    padding: 20px;
  }
  .article_content{
    border: 1px solid #eee;
    margin-bottom: 20px;
  }
</style>
<div class="panel panel-default">
  <div class="panel-heading">
    增加内容
  </div>
  <div class="panel-body">
    <div class="table-responsive input-form article_content">
      <form action="/<%=adminPath%>/article/doAdd" method="post" enctype="multipart/form-data">
        <ul id="myTab" class="nav nav-tabs">
          <li class="active">
            <a href="#index" data-toggle="tab">基本设置</a>
          </li>
          <li>
            <a href="#info" data-toggle="tab">内容详情</a>
          </li>
          <li>
            <a href="#seo" data-toggle="tab">Seo设置</a>
          </li>
        </ul>
        <div id="myTabContent" class="tab-content">
          <div class="tab-pane fade in active" id="index">
            <ul>
              <li>
                <span>所属分类：</span>
                <select name="cid" id="cid">
                  <% for(let i = 0; i < articleCate.length; i++){ %>
                    <option value="<%=articleCate[i]._id%>"><%=articleCate[i].title%></option>
                    <% for(let j = 0; j < articleCate[i].items.length; j++){ %>
                      <option value="<%=articleCate[i].items[j]._id%>">&ensp;&ensp;--<%=articleCate[i].items[j].title%></option>
                    <%}%>
                  <%}%>
                </select>
              </li>
              <li><span>内容标题：</span><input type="text" name="title"></li>
              <li><span>封面图：</span><input type="file" name="article_img"></li>
              <li><span>作者：</span><input type="text" name="author"></li>
              <li><span>排序：</span><input type="text" name="sort"></li>
              <li><span>状态：</span>
                <input type="radio" name="status" checked value="1" id="a"><label for="a">显示</label>
                <input type="radio" name="status" value="0" id="b"><label for="b">隐藏</label>
              </li>
              <li><span>加入推荐：</span>
                <input type="checkbox" name="is_best" value="1">精品
                <input type="checkbox" name="is_hot" value="2">热门
              </li>
              <li>
                <br>
                <button type="submit" class="btn btn-primary" id="submitBtn">提交</button>
              </li>
            </ul>
          </div>
          <div class="tab-pane fade" id="info">
            <textarea name="content" id="content" cols="30" rows="10"></textarea>
          </div>
          <div class="tab-pane fade" id="seo">
            <ul>
              <li><span>关键词：</span>
                <input type="text" name="keywords">
              </li>
              <li><span>Seo描述：</span>
                <textarea type="text" name="description" id="description" cols="84" rows="4"></textarea>
              </li>
            </ul>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<script>
  new FroalaEditor('#content', {
    height: '400px',
    language: 'zh_cn',
    imageUploadURL: '/<%=adminPath%>/article/doUploadImage',
    videoUploadURL: '/<%=adminPath%>/article/doUploadVideo',
  });
</script>
</body>
</html>